#FILE NAME: 6711Sources16mm_TG43_9.txt
#MC CODE: TOPAS V3.8 
#DESCRIPTION: Test case 2 – Single 6711 seed at position 10 (equivalent to position 10 in 16 mm COMS eye plaque) in water phantom; see [reference]
#DISCLAIMER: This file (and associated code/files) is provided in the hope that it will be useful
#but without any warranty; without even the implied warranty of fitness for a particular
#purpose. See full disclaimer at [link]
#COPYRIGHT (C) 2023 Luc Beaulieu (Luc.Beaulieu@phy.ulaval.ca) and Audran Poher
#REDISTRIBUTION: redistribution of this and all associated files is NOT permitted.
#SOURCE OF THIS FILE: [link]

b:Ma/MyWater/BuildFromMaterials = "True"
sv:Ma/MyWater/Components = 1 "G4_WATER"
uv:Ma/MyWater/Fractions = 1 1
d:Ma/MyWater/Density = 0.998 g/cm3    

##### WORLD #####
d:Ge/World/HLX = 15 cm
d:Ge/World/HLY = 15 cm
d:Ge/World/HLZ = 15 cm
s:Ge/World/Material = "MyWater"

# ====================================================== #
#                         PHYSICS                        #
# ====================================================== #

sv:Ph/Default/Modules                  = 1 "g4em-standard_opt4"
d:Ph/Default/CutForElectron            = 1 mm
b:Ph/Default/Auger                     = "T"
b:Ph/Default/AugerCascade              = "T"
b:Ph/Default/Fluorescence              = "T"
b:Ph/Default/DeexcitationIgnoreCut     = "T"
b:Ph/Default/PIXE                      = "T"  
    
i:Ts/Seed            = 1
i:Ts/NumberOfThreads = 0


# ====================================================== #
#                         SCORER                         #
# ====================================================== #

##### RADIAL FUNCTION SCORER #####
s:Ge/RTDoseGrid/Type       = "TsBox"
s:Ge/RTDoseGrid/Parent     = "World"
d:Ge/RTDoseGrid/HLX        =  12.75 mm
d:Ge/RTDoseGrid/HLY        =  12.75 mm
d:Ge/RTDoseGrid/HLZ        =  12.75 mm
d:Ge/RTDoseGrid/TransX     =  0 mm
d:Ge/RTDoseGrid/TransY     =  0 mm
d:Ge/RTDoseGrid/TransZ     =  12 mm
s:Ge/RTDoseGrid/Color      =  "red"
b:Ge/RTDoseGrid/IsParallel = "T"
i:Ge/RTDoseGrid/XBins      = 51
i:Ge/RTDoseGrid/YBins      = 51
i:Ge/RTDoseGrid/ZBins      = 51

#d:Sc/ScorerCyl/OnlyIncludeParticlesWithInitialKEAbove = 5. keV
s:Sc/ScorerCyl/Quantity   = "TrackLengthEstimator"
s:Sc/ScorerCyl/InputFile  = "Muen.dat"

#s:Sc/ScorerCyl/Quantity   = "DoseToMedium"
sv:Sc/ScorerCyl/Report    = 1 "Sum" 
s:Sc/ScorerCyl/Component  = "RTDoseGrid"
s:Sc/ScorerCyl/OutputFile = "6711_SeedsTG43_DoseDistribution_0"
s:Sc/ScorerCyl/OutputType                 = "DICOM"
b:Sc/ScorerCyl/DICOMOutput32BitsPerPixel  = "True"
s:Sc/ScorerCyl/IfOutputFileAlreadyExists = "Increment"
sv:Sc/ScorerCyl/OnlyIncludeParticlesNamed = 1 "gamma"
sv:Sc/ScorerCyl/OnlyIncludeIfInMaterial = 1 "MyWater"
#sv:Sc/ScorerCyl/OnlyIncludeIfNotInMaterial = 4 "MatRadioMatrix" "G4_Ag" "Titanium" "G4_AIR" 

#d:Sc/ScorerCyl1/OnlyIncludeParticlesWithInitialKEAbove = 5. keV
s:Sc/ScorerCyl1/Quantity   = "TrackLengthEstimator"
s:Sc/ScorerCyl1/InputFile  = "Muen.dat"

#s:Sc/ScorerCyl1/Quantity   = "DoseToMedium"
sv:Sc/ScorerCyl1/Report    = 1 "Standard_Deviation" 
s:Sc/ScorerCyl1/Component  = "RTDoseGrid"
s:Sc/ScorerCyl1/OutputFile = "6711_SeedsTG43_Std_DoseDistribution_0"
s:Sc/ScorerCyl1/OutputType = "csv"
s:Sc/ScorerCyl1/IfOutputFileAlreadyExists = "Increment"
sv:Sc/ScorerCyl1/OnlyIncludeParticlesNamed = 1 "gamma"
sv:Sc/ScorerCyl1/OnlyIncludeIfInMaterial = 1 "MyWater"


# ====================================================== #
#                         VIEWER                         #
# ====================================================== #

#Ge/QuitIfOverlapDetected     = "F"
s:Gr/ViewA/Type              = "OpenGL"
#i:Gr/ViewA/WindowSizeX      = 1024
#i:Gr/ViewA/WindowSizeY      = 768
d:Gr/ViewA/Theta             = 90. deg
d:Gr/ViewA/Phi               = 0. deg
#s:Gr/ViewA/Projection       = "Perspective"
#d:Gr/ViewA/PerspectiveAngle = 30. deg
u:Gr/ViewA/Zoom              = 1
b:Gr/MyGraphic1/IncludeAxes = "True" # defaults to "False"
s:Gr/ViewA/CenterOn = "World"
b:Ts/UseQt = "F"
b:Gr/Enable           = "F"
b:Ts/PauseBeforeQuit  = "F"

# ====================================================== #
#                I 125 - OncoSeed 6711                   #
# ====================================================== #
##### MATERIALS ######
sv:Ma/MatRadioMatrix/Components = 3 "Silver" "Iodine" "Bromine"
uv:Ma/MatRadioMatrix/Fractions = 3 0.5416 0.30396 0.15444
d:Ma/MatRadioMatrix/Density    = 6.2 g/cm3
#b:Ma/MatRadioMatrix/BuildFromMaterials = "T"
#sv:Ma/MatRadioMatrix/Components = 1 "G4_WATER"
#uv:Ma/MatRadioMatrix/Fractions = 1 1
#d:Ma/MatRadioMatrix/Density    = 0.998 g/cm3

s:Ge/GroupOfSeeds/Type              = "Group"
s:Ge/GroupOfSeeds/Parent            = "World"
#b:Ge/GroupOfSeeds/IsParallel        = "True"
#s:Ge/GroupOfSeeds/ParallelWorldName = "SeedsWorld"
d:Ge/GroupOfSeeds/TransX            = 0 mm
d:Ge/GroupOfSeeds/TransY            = 0 mm
d:Ge/GroupOfSeeds/TransZ            = -11 mm

sv:Ph/Default/LayeredMassGeometryWorlds = 2 "ShieldingWorld" "ActiveSourceWorld"



ic:So/ActiveSource9/NumberOfHistoriesInRun    = 5000000000   

s:Ge/Seed9/Type              = "Group"
s:Ge/Seed9/Parent            = "GroupOfSeeds"
#b:Ge/Seed9/IsParallel        = "True"
#s:Ge/Seed9/ParallelWorldName = "SeedsWorld"
d:Ge/Seed9/TransX            = 4.5 mm
d:Ge/Seed9/TransY            = 0 mm
d:Ge/Seed9/TransZ            = -1.64 mm
d:Ge/Seed9/RotX              = 90 deg
d:Ge/Seed9/RotY              = 0 deg
d:Ge/Seed9/RotZ              = 0 deg

##### SOURCE GEOMETRY #####

s:Ge/ActiveSourceGeometry9/Type              = "Group"
s:Ge/ActiveSourceGeometry9/Parent            = "Seed9"
b:Ge/ActiveSourceGeometry9/IsParallel        = "True"
s:Ge/ActiveSourceGeometry9/ParallelWorldName = "ActiveSourceWorld"

##### SOURCE #####
s:So/ActiveSource9/Type                       = "Volumetric"
s:So/ActiveSource9/Component                 = "ActiveSourceGeometry9"
sc:So/ActiveSource9/ActiveMaterial            = "MatRadioMatrix"
s:So/ActiveSource9/BeamParticle               = "gamma"
b:So/ActiveSource9/RecursivelyIncludeChildren = "T"
i:So:ActiveSource9/MaxNumberOfPointsToSample = 1000000000
s:So/ActiveSource9/BeamEnergySpectrumType     = "Discrete"

###### SPECTRUM ######
dv:So/ActiveSource9/BeamEnergySpectrumValues = 6 27.202 27.472 30.944 30.995 31.704 35.4925 keV
uv:So/ActiveSource9/BeamEnergySpectrumWeightsUnscaled = 6 0.396 0.731 0.0674 0.130 0.0375 0.0668
uv:So/ActiveSource9/BeamEnergySpectrumWeights = 0.699937006 * So/ActiveSource9/BeamEnergySpectrumWeightsUnscaled

#====================
#Radioactive cylinder
#====================

s:Ge/RadioactiveCylinder9/Type         = "TsCylinder"
s:Ge/RadioactiveCylinder9/Parent       = "ActiveSourceGeometry9"
s:Ge/RadioactiveCylinder9/Material     = "MatRadioMatrix"
d:Ge/RadioactiveCylinder9/RMin         = 0.25 mm
d:Ge/RadioactiveCylinder9/RMax         = 0.25175 mm
d:Ge/RadioactiveCylinder9/SPhi         = 0. deg
d:Ge/RadioactiveCylinder9/DPhi         = 360. deg
d:Ge/RadioactiveCylinder9/HL           = 1.325 mm
d:Ge/RadioactiveCylinder9/TransX       = 0. mm
d:Ge/RadioactiveCylinder9/TransY       = 0. mm
d:Ge/RadioactiveCylinder9/TransZ       = 0. mm
d:Ge/RadioactiveCylinder9/RotX         = 0. deg
d:Ge/RadioactiveCylinder9/RotY         = 0. deg
d:Ge/RadioactiveCylinder9/RotZ         = 0. deg
s:Ge/RadioactiveCylinder9/DrawingStyle = "FullWireFrame"
s:Ge/RadioactiveCylinder9/Color        = "yellow"
b:Ge/RadioactiveCylinder9/IsParallel   = "T"
s:Ge/RadioactiveCylinder9/ParallelWorldName = "ActiveSourceWorld"

#=====================
#Radioactive left end
#=====================
s:Ge/RadioactiveLeftEnd9/Type                   = "G4Cons"
s:Ge/RadioactiveLeftEnd9/Parent                 = "ActiveSourceGeometry9"
s:Ge/RadioactiveLeftEnd9/Material               = "MatRadioMatrix"
d:Ge/RadioactiveLeftEnd9/TransX                 = 0 mm
d:Ge/RadioactiveLeftEnd9/TransY                 = 0 mm
d:Ge/RadioactiveLeftEnd9/TransZ                 = 1.363375 mm
d:Ge/RadioactiveLeftEnd9/RotX                   = 0 deg
d:Ge/RadioactiveLeftEnd9/RotY                   = 0 deg
d:Ge/RadioactiveLeftEnd9/RotZ                   = 0 deg
d:Ge/RadioactiveLeftEnd9/RMin1                  = 0. mm
d:Ge/RadioactiveLeftEnd9/RMax1                  = 0.25175 mm
d:Ge/RadioactiveLeftEnd9/RMin2                  = 0. mm
d:Ge/RadioactiveLeftEnd9/RMax2                  = 0.17675 mm
d:Ge/RadioactiveLeftEnd9/HL                     = 0.038375 mm
d:Ge/RadioactiveLeftEnd9/SPhi                   = 0 deg
d:Ge/RadioactiveLeftEnd9/DPhi                   = 360 deg
s:Ge/RadioactiveLeftEnd9/Color                  = "yellow"
s:Ge/RadioactiveLeftEnd9/DrawingStyle           = "FullWireFrame"
b:Ge/RadioactiveLeftEnd9/IsParallel             = "T"
s:Ge/RadioactiveLeftEnd9/ParallelWorldName      = "ActiveSourceWorld"

#=====================
#Radioactive right end
#=====================
s:Ge/RadioactiveRightEnd9/Type                   = "G4Cons"
s:Ge/RadioactiveRightEnd9/Parent                 = "ActiveSourceGeometry9"
s:Ge/RadioactiveRightEnd9/Material               = "MatRadioMatrix"
d:Ge/RadioactiveRightEnd9/TransX                 = 0 mm
d:Ge/RadioactiveRightEnd9/TransY                 = 0 mm
d:Ge/RadioactiveRightEnd9/TransZ                 = -1.363375 mm
d:Ge/RadioactiveRightEnd9/RotX                   = 0 deg
d:Ge/RadioactiveRightEnd9/RotY                   = 180 deg
d:Ge/RadioactiveRightEnd9/RotZ                   = 0 deg
d:Ge/RadioactiveRightEnd9/RMin1                  = 0. mm
d:Ge/RadioactiveRightEnd9/RMax1                  = 0.25175 mm
d:Ge/RadioactiveRightEnd9/RMin2                  = 0. mm
d:Ge/RadioactiveRightEnd9/RMax2                  = 0.17675 mm
d:Ge/RadioactiveRightEnd9/HL                     = 0.038375 mm
d:Ge/RadioactiveRightEnd9/SPhi                   = 0 deg
d:Ge/RadioactiveRightEnd9/DPhi                   = 360 deg
s:Ge/RadioactiveRightEnd9/Color                  = "yellow"
s:Ge/RadioactiveRightEnd9/DrawingStyle           = "FullWireFrame"
b:Ge/RadioactiveRightEnd9/IsParallel             = "T"
s:Ge/RadioactiveRightEnd9/ParallelWorldName      = "ActiveSourceWorld"

#====================
#Silver cylinder
#====================

s:Ge/SilverCylinder9/Type         = "TsCylinder"
s:Ge/SilverCylinder9/Parent       = "ActiveSourceGeometry9"
s:Ge/SilverCylinder9/Material     = "G4_Ag"
d:Ge/SilverCylinder9/RMin         = 0. mm
d:Ge/SilverCylinder9/RMax         = 0.25 mm
d:Ge/SilverCylinder9/SPhi         = 0. deg
d:Ge/SilverCylinder9/DPhi         = 360. deg
d:Ge/SilverCylinder9/HL           = 1.325 mm
d:Ge/SilverCylinder9/TransX       = 0. mm
d:Ge/SilverCylinder9/TransY       = 0. mm
d:Ge/SilverCylinder9/TransZ       = 0. mm
d:Ge/SilverCylinder9/RotX         = 0. deg
d:Ge/SilverCylinder9/RotY         = 0. deg
d:Ge/SilverCylinder9/RotZ         = 0. deg
s:Ge/SilverCylinder9/DrawingStyle = "FullWireFrame"
s:Ge/SilverCylinder9/Color        = "grey"
b:Ge/SilverCylinder9/IsParallel   = "T"
s:Ge/SilverCylinder9/ParallelWorldName = "ActiveSourceWorld"

#=================
#Silver left end
#=================

s:Ge/SilverLeftEnd9/Type                   = "G4Cons"
s:Ge/SilverLeftEnd9/Parent                 = "RadioactiveLeftEnd9"
s:Ge/SilverLeftEnd9/Material               = "G4_Ag"
d:Ge/SilverLeftEnd9/TransX                 = 0 mm
d:Ge/SilverLeftEnd9/TransY                 = 0 mm
d:Ge/SilverLeftEnd9/TransZ                 = -0.000875 mm
d:Ge/SilverLeftEnd9/RotX                   = 0 deg
d:Ge/SilverLeftEnd9/RotY                   = 0 deg
d:Ge/SilverLeftEnd9/RotZ                   = 0 deg
d:Ge/SilverLeftEnd9/RMin1                  = 0 mm
d:Ge/SilverLeftEnd9/RMax1                  = 0.25 mm
d:Ge/SilverLeftEnd9/RMin2                  = 0 mm
d:Ge/SilverLeftEnd9/RMax2                  = 0.175 mm
d:Ge/SilverLeftEnd9/HL                     = 0.0375 mm
d:Ge/SilverLeftEnd9/SPhi                   = 0 deg
d:Ge/SilverLeftEnd9/DPhi                   = 360 deg
s:Ge/SilverLeftEnd9/Color                  = "grey"
s:Ge/SilverLeftEnd9/DrawingStyle           = "FullWireFrame"
b:Ge/SilverLeftEnd9/IsParallel             = "T"
s:Ge/SilverLeftEnd9/ParallelWorldName      = "ActiveSourceWorld"

#=================
#Silver right end
#=================

s:Ge/SilverRightEnd9/Type                   = "G4Cons"
s:Ge/SilverRightEnd9/Parent                 = "RadioactiveRightEnd9"
s:Ge/SilverRightEnd9/Material               = "G4_Ag"
d:Ge/SilverRightEnd9/TransX                 = 0 mm
d:Ge/SilverRightEnd9/TransY                 = 0 mm
d:Ge/SilverRightEnd9/TransZ                 = -0.000875 mm
d:Ge/SilverRightEnd9/RotX                   = 0 deg
d:Ge/SilverRightEnd9/RotY                   = 0 deg
d:Ge/SilverRightEnd9/RotZ                   = 0 deg
d:Ge/SilverRightEnd9/RMin1                  = 0 mm
d:Ge/SilverRightEnd9/RMax1                  = 0.25 mm
d:Ge/SilverRightEnd9/RMin2                  = 0 mm
d:Ge/SilverRightEnd9/RMax2                  = 0.175 mm
d:Ge/SilverRightEnd9/HL                     = 0.0375 mm
d:Ge/SilverRightEnd9/SPhi                   = 0 deg
d:Ge/SilverRightEnd9/DPhi                   = 360 deg
s:Ge/SilverRightEnd9/Color                  = "grey"
s:Ge/SilverRightEnd9/DrawingStyle           = "FullWireFrame"
b:Ge/SilverRightEnd9/IsParallel             = "T"
s:Ge/SilverRightEnd9/ParallelWorldName      = "ActiveSourceWorld"

##### SHIELDING #####

s:Ge/ShieldingGeo9/Type              = "Group"
s:Ge/ShieldingGeo9/Parent            = "Seed9"
b:Ge/ShieldingGeo9/IsParallel        = "True"
s:Ge/ShieldingGeo9/ParallelWorldName = "ShieldingWorld"


#=====================
#Cylinder of Titanium
#=====================

s:Ge/TitaniumCylinder9/Type         = "TsCylinder"
s:Ge/TitaniumCylinder9/Parent       = "ShieldingGeo9"
s:Ge/TitaniumCylinder9/Material     = "G4_Ti"
d:Ge/TitaniumCylinder9/RMin         = 0.33 mm
d:Ge/TitaniumCylinder9/RMax         = 0.40 mm
d:Ge/TitaniumCylinder9/SPhi         = 180. deg
d:Ge/TitaniumCylinder9/DPhi         = 360. deg
d:Ge/TitaniumCylinder9/HL           = 1.875 mm
d:Ge/TitaniumCylinder9/TransX       = 0. mm
d:Ge/TitaniumCylinder9/TransY       = 0. mm
d:Ge/TitaniumCylinder9/TransZ       = 0. mm
d:Ge/TitaniumCylinder9/RotX         = 0. deg
d:Ge/TitaniumCylinder9/RotY         = 0. deg
d:Ge/TitaniumCylinder9/RotZ         = 0. deg
s:Ge/TitaniumCylinder9/Color        = "blue"
s:Ge/TitaniumCylinder9/DrawingStyle = "FullWireFrame"
b:Ge/TitaniumCylinder9/IsParallel   = "T"
s:Ge/TitaniumCylinder9/ParallelWorldName = "ShieldingWorld"

#===============================
#Left half-sphere of Titanium 
#===============================

s:Ge/TitaniumLeftCap9/Type         = "TsSphere"
s:Ge/TitaniumLeftCap9/Parent       = "ShieldingGeo9"
s:Ge/TitaniumLeftCap9/Material     = "G4_Ti"
d:Ge/TitaniumLeftCap9/RMin         = 0. mm
d:Ge/TitaniumLeftCap9/RMax         = 0.4 mm
d:Ge/TitaniumLeftCap9/SPhi         = 0. deg
d:Ge/TitaniumLeftCap9/DPhi         = 360. deg
d:Ge/TitaniumLeftCap9/STheta       = 0. deg
d:Ge/TitaniumLeftCap9/DTheta       = 90. deg
d:Ge/TitaniumLeftCap9/TransX       = 0. mm
d:Ge/TitaniumLeftCap9/TransY       = 0. mm
d:Ge/TitaniumLeftCap9/TransZ       = 1.875 mm
d:Ge/TitaniumLeftCap9/RotX         = 0. deg
d:Ge/TitaniumLeftCap9/RotY         = 0. deg
d:Ge/TitaniumLeftCap9/RotZ         = 0. deg
s:Ge/TitaniumLeftCap9/DrawingStyle = "FullWireFrame"
s:Ge/TitaniumLeftCap9/Color        = "blue"
b:Ge/TitaniumLeftCap9/IsParallel   = "T"
s:Ge/TitaniumLeftCap9/ParallelWorldName = "ShieldingWorld"

#================================
#Right half-sphere of titanium
#================================

s:Ge/TitaniumRightCap9/Type         = "TsSphere"
s:Ge/TitaniumRightCap9/Parent       = "ShieldingGeo9"
s:Ge/TitaniumRightCap9/Material     = "G4_Ti"
d:Ge/TitaniumRightCap9/RMin         = 0. mm
d:Ge/TitaniumRightCap9/RMax         = 0.4 mm
d:Ge/TitaniumRightCap9/SPhi         = 0. deg
d:Ge/TitaniumRightCap9/DPhi         = 360. deg
d:Ge/TitaniumRightCap9/STheta       = 0. deg
d:Ge/TitaniumRightCap9/DTheta       = 90. deg
d:Ge/TitaniumRightCap9/TransX       = 0. mm
d:Ge/TitaniumRightCap9/TransY       = 0. mm
d:Ge/TitaniumRightCap9/TransZ       = -1.875 mm
d:Ge/TitaniumRightCap9/RotX         = 180. deg
d:Ge/TitaniumRightCap9/RotY         = 0. deg
d:Ge/TitaniumRightCap9/RotZ         = 0. deg
s:Ge/TitaniumRightCap9/DrawingStyle = "FullWireFrame"
s:Ge/TitaniumRightCap9/Color        = "blue"
b:Ge/TitaniumRightCap9/IsParallel   = "T"
s:Ge/TitaniumRightCap9/ParallelWorldName = "ShieldingWorld"

#====================
#Dry Air cylinder
#====================

s:Ge/DryAirCylinder9/Type         = "TsCylinder"
s:Ge/DryAirCylinder9/Parent       = "ShieldingGeo9"
s:Ge/DryAirCylinder9/Material     = "G4_AIR"
d:Ge/DryAirCylinder9/RMin         = 0. mm
d:Ge/DryAirCylinder9/RMax         = 0.33 mm
d:Ge/DryAirCylinder9/SPhi         = 0. deg
d:Ge/DryAirCylinder9/DPhi         = 360. deg
d:Ge/DryAirCylinder9/HL           = 1.875 mm
d:Ge/DryAirCylinder9/TransX       = 0. mm
d:Ge/DryAirCylinder9/TransY       = 0. mm
d:Ge/DryAirCylinder9/TransZ       = 0. mm
d:Ge/DryAirCylinder9/RotX         = 0. deg
d:Ge/DryAirCylinder9/RotY         = 0. deg
d:Ge/DryAirCylinder9/RotZ         = 0. deg
s:Ge/DryAirCylinder9/DrawingStyle = "FullWireFrame"
s:Ge/DryAirCylinder9/Color        = "white"
b:Ge/DryAirCylinder9/IsParallel   = "T"
s:Ge/DryAirCylinder9/ParallelWorldName = "ShieldingWorld"



